<template>
  <a-layout-sider
    :class="['sider', isDesktop() ? null : 'shadow', theme, fixSiderbar ? 'ant-fixed-sidemenu' : null ]"
    width="256px"
    :collapsible="collapsible"
    v-model="collapsed"
    :trigger="null">
    <logo title="智慧溆浦·智慧医疗"/>
    <div class="child-logo" v-if="isDesktop()">
      <img src="../../../public/theme-logo.png" style="margin-right:10px; max-width:40px;" alt="">
      双向转诊系统
    </div>
    <s-menu
      :collapsed="collapsed"
      :menu="menus"
      :theme="theme"
      :mode="mode"
      @select="onSelect"
      style="padding: 16px 0px;"></s-menu>
  </a-layout-sider>

</template>

<script>
import Logo from '@/components/tools/Logo'
import SMenu from './index'
import { mixin, mixinDevice } from '@/utils/mixin'

export default {
  name: 'SideMenu',
  components: { Logo, SMenu },
  mixins: [mixin, mixinDevice],
  props: {
    mode: {
      type: String,
      required: false,
      default: 'inline'
    },
    theme: {
      type: String,
      required: false,
      default: 'dark'
    },
    collapsible: {
      type: Boolean,
      required: false,
      default: false
    },
    collapsed: {
      type: Boolean,
      required: false,
      default: false
    },
    menus: {
      type: Array,
      required: true
    }
  },
  methods: {
    onSelect (obj) {
      this.$emit('menuSelect', obj)
    }
  }
}
</script>
<style>
  .child-logo {
  width: 220px;
  height: 64px;
  margin: auto;
  margin-top: 10px;
  color: rgba(46,187,255,1);
  font-family: Microsoft YaHei;
  font-size: 14px;
  font-weight: bold;
  line-height: 64px;
  text-align: center;
  background: rgba(234,248,255,1);
  border-radius: 0 18px 18px 18px;
}
</style>
